#include <stdio.h>

#include<math.h>

int maxf(int a, int b)

{

 return a > b? a : b;

}

int minf(int a, int b)

{

 return a < b? a : b;

}

int main()

{

 int sorce[5][2] = { 0 };

 int i = 0, j = 0, max = 0, min = 10;

 double avg = 0, all = 0;

 for (i = 0; i < 5; i++)

 {

 for (j = 0; j < 2; j++)

 {

 scanf("%d", &sorce[i][j]);

 }

 all += sorce[i][1];

 }

 for (i = 0; i < 5; i++)

 {

 max=maxf(max,sorce[i][1]);

 min=minf(min,sorce[i][1]);

 }

 all = all - max - min;

 avg = all / 3.0;

 printf("%.2lf\n", avg);

 int distance = 0, distance_min = 20;

 for (i = 0; i < 5; i++)

 {

 distance_min = minf(distance_min, abs(sorce[i][1] - round(avg)));

 }

 for (i = 0; i < 5; i++)

 {

 distance = sorce[i][1] - round(avg);

 if (distance_min - abs(distance)<0.1&&distance_min - abs(distance)>-0.1)

 {

 printf("%d", sorce[i][0]);

 break;

 }

 }

 return 0;

}
